﻿<Page x:Class="MediaLibrary.Controls.WatchFolderPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WatchFolderPage">
    <Grid Name="mainColumn" ScrollViewer.CanContentScroll="True">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="85" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Grid.ColumnSpan="2">
            <Label>Watch Folders</Label>
            <TextBlock Margin="10,0,10,0" TextWrapping="Wrap">A watch folder is a folder that contains the media files you want available to the media library. When you update/add/edit files the media library will automatically be updated.</TextBlock>
        </StackPanel>

        <GroupBox Grid.Row="1" BorderThickness="1" BorderBrush="Black">
            <GroupBox.Header>
                <ComboBox x:Name="watchFolderModeComboBox" SelectionChanged="watchFolderModeComboBox_SelectionChanged">
                    <ComboBoxItem Name="doNotScanComboBoxItem">Do Not Scan Computer</ComboBoxItem>
                    <ComboBoxItem Name="fullScanComboBoxItem">Full Computer Scan</ComboBoxItem>
                    <ComboBoxItem Name="enableWatchFoldersComboBoxItem">Enable Watch Folders</ComboBoxItem>
                </ComboBox>
            </GroupBox.Header>

            <Grid Grid.Row="1" Name="watchFolderGrid" Margin="3" IsEnabled="{Binding ElementName=watchFolderModeComboBox, Path=SelectedItem.IsSelected}" Width="{Binding ElementName=mainColumn, Path=Width}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="180" />
                    <RowDefinition Height="100" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <StackPanel Grid.Row="0" Grid.Column="0">
                    <Label>Music Watch Folders</Label>
                    <StackPanel Margin="10,0,10,0" Orientation="Horizontal">
                        <TextBlock TextWrapping="Wrap" Margin="0,3,0,0">Add Music Watch Folder</TextBlock>
                        <Button x:Name="addMusicWatchFolderButton" Click="addMusicWatchFolderButton_Click">Add Folder</Button>
                    </StackPanel>
                    <ListBox x:Name="musicListBox" Margin="10,10,10,00" SelectionMode="Extended" KeyDown="musicListBox_KeyDown" Height="80" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Auto">

                    </ListBox>
                    <TextBlock Margin="10,0,10,0" TextWrapping="Wrap">To remove a watch folder, select the folder and press the delete key.</TextBlock>
                </StackPanel>

                <StackPanel Grid.Row="0" Grid.Column="1">
                    <Label>Video Watch Folders</Label>
                    <StackPanel Margin="10,0,10,0" Orientation="Horizontal">
                        <TextBlock TextWrapping="Wrap" Margin="0,3,0,0">Add Video Watch Folder</TextBlock>
                        <Button x:Name="addVideoWatchFolderButton" Click="addVideoWatchFolderButton_Click">Add Folder</Button>
                    </StackPanel>
                    <ListBox x:Name="videoListBox" Margin="10,10,10,00" SelectionMode="Extended" KeyDown="videoListBox_KeyDown" Height="80" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Auto">

                    </ListBox>
                    <TextBlock Margin="10,0,10,0" TextWrapping="Wrap">To remove a watch folder, select the folder and press the delete key.</TextBlock>
                </StackPanel>

                <StackPanel Grid.Row="1" Grid.ColumnSpan="2">
                    <Label>Watch Folder Scan Interval</Label>
                    <TextBlock Margin="10,0,10,0">Update the time interval using the textbox and click the 'Save' button to finalize the change.</TextBlock>
                    <StackPanel Margin="10,10,10,0" Orientation="Horizontal">
                        <TextBlock Margin="0,3,10,0">Current Scan Interval (Minutes):</TextBlock>
                        <TextBox x:Name="timeIntervalTextBox" Width="80"></TextBox>
                        <Button Margin="20,0,0,0" Click="saveItemIntervalButton_Click">Save</Button>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </GroupBox>    
    </Grid>
</Page>
